package com.furongji.education.controller.api;

import com.furongji.common.domain.vo.VideoPlayPageVo;
import com.furongji.common.result.Result;
import com.furongji.education.service.AliyunVodService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@Tag(name = "阿里云视频点播")
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/vod")
public class VodApiController {

    private final AliyunVodService aliyunVodService;

    @Operation(summary = "获取播放凭证")
    @GetMapping("/getVideoAuth/{videoId}")
    public Result getVideoAuth(@PathVariable String videoId) {
//        String videoAuth = vodOperator.getVideoAuth(videoId);
//        return Result.success(videoAuth);
        VideoPlayPageVo videoPlayPageVo = aliyunVodService.getVideoAuthInfo(videoId);
        return Result.success(videoPlayPageVo);
    }

}
